// 模拟数据API
export const fetchCategoryProductCount = async () => {
  // 模拟从后端获取各类目商品数量
  return [
    { categoryName: '电子产品', productCount: 156 },
    { categoryName: '家居用品', productCount: 89 },
    { categoryName: '服装服饰', productCount: 120 },
    { categoryName: '食品饮料', productCount: 76 },
    { categoryName: '图书音像', productCount: 64 },
    { categoryName: '运动户外', productCount: 53 }
  ]
}

export const fetchProductPriceDistribution = async () => {
  // 模拟商品价格分布数据
  return [
    { range: '0-100元', count: 120 },
    { range: '100-300元', count: 85 },
    { range: '300-500元', count: 45 },
    { range: '500-1000元', count: 30 },
    { range: '1000元以上', count: 15 }
  ]
}

export const fetchCategorySales = async () => {
  // 模拟各类目销量数据
  return [
    { categoryName: '电子产品', totalSales: 1250 },
    { categoryName: '家居用品', totalSales: 876 },
    { categoryName: '服装服饰', totalSales: 1532 },
    { categoryName: '食品饮料', totalSales: 2543 },
    { categoryName: '图书音像', totalSales: 432 },
    { categoryName: '运动户外', totalSales: 765 }
  ]
}

export const fetchTopProductsStock = async () => {
  // 模拟热门商品库存数据
  const dates = ['1月', '2月', '3月', '4月', '5月', '6月']
  return [
    {
      productName: '智能手机X',
      stockData: dates.map((date, i) => ({
        date,
        stock: 500 - i * 80 + Math.floor(Math.random() * 50)
      }))
    },
    {
      productName: '无线耳机Pro',
      stockData: dates.map((date, i) => ({
        date,
        stock: 300 - i * 40 + Math.floor(Math.random() * 30)
      }))
    },
    {
      productName: '智能手表',
      stockData: dates.map((date, i) => ({
        date,
        stock: 200 - i * 20 + Math.floor(Math.random() * 25)
      }))
    }
  ]
}